package testing;

import processing.core.*; 
import processing.xml.*; 

import java.applet.*; 
import java.awt.Dimension; 
import java.awt.Frame; 
import java.awt.event.MouseEvent; 
import java.awt.event.KeyEvent; 
import java.awt.event.FocusEvent; 
import java.awt.Image; 
import java.io.*; 
import java.net.*; 
import java.text.*; 
import java.util.*; 
import java.util.zip.*; 
import java.util.regex.*; 

public class energyDiagram extends PApplet {

/**
 * Simple Radial Gradient 
 * by Ira Greenberg. 
 * 
 * Using the convenient red(), green() 
 * and blue() component functions,
 * generate an array of radial gradients.
 */
 
public void setup(){
  size(200, 200);
  background(0);
  smooth();

  
}

public void draw(){
	// create a simple table of gradients
	ellipse(56, 46, 55, 55);
}

 //represent the source of the energy
 class energySource{
 
	 int x;
	 int y;
	 int size;
	 energySource(int x, int y, int size){
		this.x = x;
		this.y = y;
		this.size = size;
	 }
	 
	 public void display(){
		 ellipse(56, 46, 55, 55);
	 }
	 
 }
 
 class heatSink{
	 int x;
	 int y;
	 int size;
	 heatSink(int x, int y, int size){
		this.x = x;
		this.y = y;
		this.size = size;
	 }
	 
	 public void display(){
		 line(x, y, x, y+size);
		 line(x-5,y+size-5,x,y+size);
		 line(x+5,y+size-5,x,y+size);
		 line(x-15,y+size,x+15,y+size);
		 line(x-10,y+size+5,x+10,y+size+5);
		 line(x-5,y+size+5,x+5,y+size+5);
	 }
 }
 
 class storageTank{
	 int x;
	 int y;
	 int size;
	 heatSink hs = null;
	 storageTank(int x, int y, int size){
		this.x = x;
		this.y = y;
		this.size = size;
		hs = new heatSink(x,y+35,5);
	 }
	 
	 public void display(){
		 line(x,y,x-20,y+10);
		 line(x,y,x+20,y+10);
		 line(x-20,y+10,x-20,y+15);
		 line(x+20,y+10,x+20,y+15);
		 arc(x,y+15,20,20,0,PI);
		 hs.display();
	 }
 }
 
 class productionUnit{
	 int x;
	 int y;
	 int size;
	 heatSink hs = null;
	 productionUnit(int x, int y,int size){
		 this.x = x;
		 this.y = y;
		 this.size = size;
		 hs = new heatSink(x+15,y+5,5);
	 }
	 
	 public void display(){
		 line(x,y,x+10,y);
		 line(x+10-2,y-2,x+10,y);
		 line(x+10-2,y+2,x+10,y);
		 
		 line(x+10,y-5,x+10,y+5);
		 line(x+10,y-5,x+20,y-5);
		 line(x+10,y+5,x+20,y+5);
		 
		 arc(x+20,y,5,5,-PI/2,PI);
		 
		 line(x+20,y,x+30,y);
		 line(x+30-2,y-2,x+30,y);
		 line(x+30-2,y+2,x+30,y);
		 
		 line(x+15,y-10,x+15,y-5);
		 line(x+15-2,y-5-2,x+15,y-5);
		 line(x+15+2,y-5-2,x+15,y-5);
		 
		 hs.display();
	 }
 }
 
 class consumptionUnit{
	 
	 consumptionUnit(){}
 }
 
 class workGate{
	 workGate(){
		 
	 }
 }
  
 
}
